package com.mobibusbr.webservices;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ConnectException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

import com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException;

public class ValidandoDFTrans {
	
	private static final String ENDERECO_SERVIDOR_ATUALIZACAO = "http://www.google.com";

	public boolean arquivosServidorDisponiveis() {

		try {
			URL url = new URL(ENDERECO_SERVIDOR_ATUALIZACAO);
			URLConnection urlconnect = url.openConnection();
						
			BufferedReader in = new BufferedReader(new InputStreamReader(urlconnect.getInputStream()));
			String inputLine;

			while ((inputLine = in.readLine()) != null) {
				System.out.println(inputLine);
			}
			in.close();
			return true;	
		} catch (MalformedURLException e) {
			e.printStackTrace();

			return false;
		}catch (ConnectException e) {
			e.printStackTrace();
			return false;
		} catch (IOException e) {
			e.printStackTrace();
			return false;
		} catch (ParseException e) {
			e.printStackTrace();
			return false;
		}

	}
	
	public static void main(String[] args) {
		
		ValidandoDFTrans a = new ValidandoDFTrans();
		a.arquivosServidorDisponiveis();
	}

}
